import { createRouter, createWebHashHistory } from 'vue-router'

import adminRoute from './admin'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      ame: 'index',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/test.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/login.vue')
    },
    {
      path: '/editor',
      name: 'editor',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/editor.vue')
    },
    {
      path: '/editorMd',
      name: 'editorMd',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/editorMd.vue')
    },
    {
      path: '/test',
      name: 'test',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/test.vue')
    },
    {
      path: '/list',
      name: 'list',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/list.vue')
    },
    {
      path: '/note/read/:id',
      name: 'read',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/read.vue') // 假设有一个 User 组件
    },
    ...adminRoute
  ]
})

export default router
